import time
from selenium import webdriver

driver = webdriver.Chrome()
driver.get("http://localhost/index.php")
driver.find_element_by_xpath("//a[text()='注册']").click()
driver.find_element_by_css_selector("[name = 'username']").send_keys("13168514931")
driver.find_element_by_css_selector("[placeholder ='图像验证码']").send_keys("8888")
driver.find_element_by_xpath("//input[@id='password' and @name = 'password']").send_keys("wang1234")
driver.find_element_by_xpath("//*[@id='password2']").send_keys("wang1234")
driver.find_element_by_link_text("同意协议并注册").click()
time.sleep(5)
driver.quit()